Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Jun 18, 2025

Resolves #17077

Summary by CodeRabbit

  • New Features

    • Added the ability to retrieve all bookable slots within a specified date and time range.
  • Bug Fixes

    • Incremented version numbers for multiple booking actions and event sources to ensure up-to-date functionality and compatibility.
  • Chores

    • Updated package version for improved tracking and maintenance.

Actions
 - Get Bookable Slots
@luancazarine luancazarine linked an issue Jun 18, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Jun 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jun 19, 2025 2:59pm
pipedream-docs ⬜️ Ignored (Inspect) Jun 19, 2025 2:59pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 19, 2025 2:59pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 18, 2025

"""

Walkthrough

A new "Get Bookable Slots" action and supporting method were added to the Cal.com integration, enabling retrieval of available booking slots within a datetime range. Several action and source files had their version numbers incremented, and the package version was updated. No other logic or structural changes were made.

Changes

File(s) Change Summary
components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs Added new action to fetch bookable slots within a datetime range.
components/cal_com/cal_com.app.mjs Added new getBookableSlots method to app methods.
components/cal_com/actions/create-booking/create-booking.mjs
components/cal_com/actions/delete-booking/delete-booking.mjs
components/cal_com/actions/get-booking/get-booking.mjs
components/cal_com/sources/booking-cancelled/booking-cancelled.mjs
components/cal_com/sources/booking-created/booking-created.mjs
components/cal_com/sources/booking-ended/booking-ended.mjs
components/cal_com/sources/booking-rescheduled/booking-rescheduled.mjs
Incremented version numbers in action and source files.
components/cal_com/package.json Incremented package version from 0.0.5 to 0.0.6.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GetBookableSlotsAction
    participant CalComApp

    User->>GetBookableSlotsAction: Provide eventTypeId, startTime, endTime, etc.
    GetBookableSlotsAction->>CalComApp: getBookableSlots(args)
    CalComApp->>CalComApp: _makeRequest({ path: "slots", ...args })
    CalComApp-->>GetBookableSlotsAction: Return slots data
    GetBookableSlotsAction-->>User: Return slots data and summary
Loading

Assessment against linked issues

Objective Addressed Explanation
Add ability to fetch all bookable slots between a datetime range for Cal.com (#17077)

Suggested reviewers

  • jcortes

Poem

In the warren of code, a new slot appears,
Fetching availabilities, allaying your fears.
Version bumps hop by, as rabbits do,
Now Cal.com’s ready to serve slots to you!
With paws on the keys and whiskers that twitch,
This bunny’s made booking slots easy and rich.
🐇✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5734007 and 342eaae.

📒 Files selected for processing (1)
  • components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
components/cal_com/cal_com.app.mjs (1)

160-165: Consider adding a thin parameter wrapper / docblock for clarity
getBookableSlots simply forwards any args object to _makeRequest, which is flexible but leaves the call-site responsible for remembering to put everything under a params key ({ params: { eventTypeId, start, end, … } }). A tiny wrapper (or at least a JSDoc comment) that takes the canonical arguments and builds the params object would:

  • make the public signature self-describing (getBookableSlots({ eventTypeId, start, end, timeZone, teamEvent, $ }))
  • provide a good place to validate required params (ISO-8601, non-empty, etc.)
  • avoid accidental leaking of unsupported keys into the request config

Example diff (optional):

-  async getBookableSlots(args = {}) {
-    return this._makeRequest({
-      path: "slots",
-      ...args,
-    });
-  },
+  /**
+   * Retrieve available slots for an event type.
+   * @param {Object} opts
+   * @param {string} opts.eventTypeId  – required
+   * @param {string} opts.start        – ISO-8601
+   * @param {string} opts.end          – ISO-8601
+   * @param {string} [opts.timeZone]
+   * @param {boolean}[opts.teamEvent]
+   * @param {*}      [opts.$]          – Pipedream `$` for logging / retries
+   */
+  async getBookableSlots({
+    eventTypeId,
+    start,
+    end,
+    timeZone,
+    teamEvent,
+    $ = this,
+  } = {}) {
+    return this._makeRequest({
+      path: "slots",
+      params: {
+        eventTypeId,
+        start,
+        end,
+        timeZone,
+        teamEvent,
+      },
+      $,
+    });
+  },
components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs (2)

1-2: Avoid shadowing the imported app reference.

app is imported at the top-level and then re-declared in run() via object destructuring, which can be confusing. Giving the import a distinct name (e.g. calCom) improves clarity and eliminates the shadowing.

-import app from "../../cal_com.app.mjs";
+import calCom from "../../cal_com.app.mjs";

Remember to update the props block and later references (this.calCom.getBookableSlots) accordingly.


17-26: Provide stronger typing/validation for the datetime inputs.

startTime and endTime are plain strings, so invalid or non-ISO formats will silently pass through to the API. At minimum, add simple validation or leverage a date-picker/"datetime" UI type if supported.

Example quick guard:

-    startTime: {
+    startTime: {
       type: "string",
       label: "Start Time",
       description: "Start time of the slot lookup (ISO 8601 format)",
+      async validate(value) {
+        if (Number.isNaN(Date.parse(value))) {
+          throw new Error("startTime must be a valid ISO-8601 datetime");
+        }
+      },
     },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7851ded and 5734007.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • components/cal_com/actions/create-booking/create-booking.mjs (1 hunks)
  • components/cal_com/actions/delete-booking/delete-booking.mjs (1 hunks)
  • components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs (1 hunks)
  • components/cal_com/actions/get-booking/get-booking.mjs (1 hunks)
  • components/cal_com/cal_com.app.mjs (1 hunks)
  • components/cal_com/package.json (1 hunks)
  • components/cal_com/sources/booking-cancelled/booking-cancelled.mjs (1 hunks)
  • components/cal_com/sources/booking-created/booking-created.mjs (1 hunks)
  • components/cal_com/sources/booking-ended/booking-ended.mjs (1 hunks)
  • components/cal_com/sources/booking-rescheduled/booking-rescheduled.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (10)
components/cal_com/actions/get-booking/get-booking.mjs (1)

7-7: Version bump looks good
No behavioural change – just metadata alignment with the package patch version.

components/cal_com/package.json (1)

3-3: Package version updated to 0.0.6
Consistent with the individual action/source bumps. ✅

components/cal_com/sources/booking-rescheduled/booking-rescheduled.mjs (1)

8-8: Source version bump acknowledged
Maintains internal consistency; no further comments.

components/cal_com/actions/create-booking/create-booking.mjs (2)

2-2: Import re-ordering is harmless but watch linter rules
Many style guides expect third-party imports first, then local imports. The new order (ConfigurationError → local calCom) still satisfies that convention; just ensure it passes the repo’s lint step.


8-8: Version bump only
No functional changes introduced – LGTM.

components/cal_com/sources/booking-ended/booking-ended.mjs (1)

8-8: Version bump looks good.

No functional changes detected; incrementing the version keeps the source in sync with the rest of the package.

components/cal_com/sources/booking-cancelled/booking-cancelled.mjs (1)

8-8: Version bump looks good.

Change is purely declarative and poses no risk.

components/cal_com/sources/booking-created/booking-created.mjs (1)

8-8: Version bump looks good.

Consistent with related sources; nothing else to address.

components/cal_com/actions/delete-booking/delete-booking.mjs (1)

7-7: Version bump looks good.

Action logic unchanged; update is purely metadata.

components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs (1)

7-7: Consider aligning the initial version with existing actions.

Existing Cal.com actions are at 0.0.3. Starting this new action at 0.0.3 keeps a flat, easy-to-reason-about version surface for consumers.
If you want semantic independence, keeping 0.0.1 is fine—just double-check that your release process tolerates mixed versions.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a prop description suggestion. Moving forward to QA

@luancazarine
Copy link
Collaborator Author

/approve

@luancazarine luancazarine merged commit b3f70c3 into master Jun 21, 2025
11 checks passed
@luancazarine luancazarine deleted the 17077-app-calcom branch June 21, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[APP] Cal.com

3 participants